add_subdirectory(../../src src)

add_executable(rtc-signal ${RTC_XSWITCH_SOURCES} ${RTP_SOURCES} main_rtc_signal.cpp)

link_directories(
        ${AVFORMAT_LIBRARY_DIRS}
        ${AVCODEC_LIBRARY_DIRS}
        ${AVUTIL_LIBRARY_DIRS}
        ${VPX_LIBRARY_DIRS}
        ${CMAKE_SOURCE_DIR}/stage/lib/
)

target_link_libraries(rtc-signal
        ${LOG4CPLUS_LDFLAGS}
        ${GLIB_LDFLAGS}
        ${GOBJECT_LDFLAGS}
        ${GIO_LDFLAGS}
	-ldl
        ${OPENSSL_LDFLAGS}
        ${OPUS_LDFLAGS}
        ${LIBSOUP_LDFLAGS}
        ${SRTP_LDFLAGS}
        ${NICE_LDFLAGS}
        ${VPX_STATIC_LIBRARIES}
        "-L${CMAKE_SOURCE_DIR}/third/webrtc/lib/ -laudio_recveq -lpthread"
        ${AVFORMAT_STATIC_LIBRARIES}
        ${AVCODEC_STATIC_LIBRARIES}
        ${AVUTIL_STATIC_LIBRARIES}
        -lmp3lame
        )

if (APPLE)
    set_target_properties(rtc-signal PROPERTIES LINK_FLAGS "-framework CoreServices")
endif (APPLE)

if (LIBEXECINFO_STANDALONE)
    target_link_libraries(rtc-signal -lexecinfo)
endif(LIBEXECINFO_STANDALONE)

install(TARGETS rtc-signal DESTINATION bin)
